package com.mes.controller;


import com.mes.entity.Technology;
import com.mes.service.TechnologyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @BelongsPackage: com.mes.controller
 * @Author: 源源瞬转
 * @CreateTime: 2024-09-24  14:14
 * @Description TODO:
 */
@RestController
@RequestMapping("/TechnologyController")
public class TechnologyController {


    @Autowired
    private TechnologyService technologyService;

    @PostMapping("/listByPage/{pageNum}/{pageSize}")
    public Map listByPage(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody Technology technology) {
        Map map = technologyService.listByPage(pageNum, pageSize, technology);
        return map;

    }

    @PostMapping("/save")
    public int save(@RequestBody Technology technology) {
        int i = technologyService.save(technology);
        return i;
    }

    @PutMapping("/update")
    public int update(@RequestBody Technology technology) {
        int i = technologyService.update(technology);
        return i;
    }

    @DeleteMapping("/deleteById")
    public int deleteById(Integer id) {
        int i = technologyService.deleteById(id);
        return i;
    }


}
